#ifndef QSIM_H
#define QSIM_H

#include <QtGui>
#include "QCPU.h"

class QSim : public QMainWindow
{
    Q_OBJECT
    
public:

    QString mLog;

    void writeLog(QString&);

    QSim(QWidget *parent = 0);
    ~QSim();

private slots:
    void createCPU();
    void clearLog();
    void openFileDialog();
    void startCPU();
    void clockCycle();

private :

    void createComboBoxForSelectCPU();
    void createMemorySelectRadioGroup();
    void createLCDall();
    void displayLCD();

    QWidget *mMainWidget;

    QTextEdit *mLogText;
    QLabel *mLogLabel;
    QPushButton *mPushButtonForLogClear;

    QLabel *mLabelForComboboxLabel;
    QComboBox *mComboBoxForSelectCPU;

    QLineEdit *mLineEditForClock;
    QLabel *mLabelForClock;

    QPushButton *mPushButtonForCreateCPU;

    QGroupBox *mRadioGroup;
    QVBoxLayout *mVLayout;
    QRadioButton *mRadioMemorySelectInRom;
    QRadioButton *mRadioMemorySelectExRam;
    QRadioButton *mRadioMemorySelectExRom;

    QPushButton *mPushButtonForLoadHex;
    QPushButton *mPushButtonForCPUstart;


    QLabel *mLabelforACC_LCD;
    QLabel *mLabelforPC_LCD;
    QLabel *mLabelforP0_LCD;
    QLabel *mLabelforP1_LCD;
    QLabel *mLabelforP2_LCD;
    QLabel *mLabelforP3_LCD;

    QLCDNumber *mACC_LCD;
    QLCDNumber *mPC_LCD;
    QLCDNumber *mP0_LCD;
    QLCDNumber *mP1_LCD;
    QLCDNumber *mP2_LCD;
    QLCDNumber *mP3_LCD;

    QCPU *mCPU;
    QTimer *mTimer;
    int mClock;
    int mClockCycle;

};

#endif // QSIM_H
